function times(cb,length) {
    let count = 0;
    return function () {
        if (++count === length) {
            cb();
        }
    }
}


let newfn = times(() => {
    console.log('真正执行的任务')
},3);
newfn();